The present invention relates to a method and apparatus for optically reading codes using a charge coupled device, and is especially related to a method for reading a code label in a stable manner whether positioned far or near and a code reader for effecting the code reading.
Various kinds of code readers have been developed and used for reading code symbols recorded on code labels. For instance, a typical bar-code reader is known which comprises a light emitting device, such as light emitting diode (LED) or the like, and a photo detecting device such as a charge coupled device (CCD). In this bar-code reader, a predetermined light is emitted from the light emitting device toward a bar code label carrying a bar code provided thereon, and the incident light is reflected by the bar code label toward the photo detecting device through an image-forming lens or the like. The detected light is converted into a predetermined electric signal and coded information on the bar code label is thus read.
Usually in such bar-code readers an amount of light incident upon the CCD varies from one bar code label to another. To compensate for the variation of the light amount, any of the following is adopted:
(1) gain (amplification factor) of an analog signal stored in the CCD is initially set to have an optimal large margin; or PA1 (2) an automatic gain control (AGC) circuit is provided to automatically control the gain according to a light amount reflected from a bar code label.
Therefore, depending upon external factors such as ambient brightness, distance between a bar code label and bar-code reader, and an orientation of the bar-code reader, the signal level in such bar-code readers will change greatly in connection with the light amount and focal distance of the CCD. Even if an optimum gain is set, the bar-code reader is likely to fail in correctly reading the information on the bar code.
The bar-code reader provided with an AGC circuit also suffers a deficiency in that if a dark and light pattern, having a high reflectance, exists near a bar code on a label and a reflected light from the pattern is incident upon the bar-code reader which is correctly directed toward the bar code label, the pattern is sometimes mistaken for a bar code by the bar-code reader. Thus, no optimum gain control is possible. The provision in the bar-code reader of an AGC circuit, which is a complicated analog circuit, also also increases manufacturing costs and dimensions of the bar-code reader.